# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=beanstalkd
pkgver=1.12
pkgrel=1
pkgdesc="Beanstalk is a simple, fast work queue"
url="http://kr.github.io/beanstalkd/"
arch="all"
license="MIT"
makedepends="clang"
install="$pkgname.pre-install"
pkgusers="beanstalk"
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/kr/beanstalkd/archive/v$pkgver.tar.gz
	$pkgname.confd
	$pkgname.initd
	remove-werror.patch
	"

build() {
	make
}

package() {
	mkdir -p "$pkgdir"/var/lib/beanstalkd
	chown $pkgusers "$pkgdir"/var/lib/beanstalkd
	make PREFIX="$pkgdir"/usr install
	install -Dm755 "$srcdir"/$pkgname.initd \
		"$pkgdir"/etc/init.d/$pkgname
	install -Dm644 "$srcdir"/$pkgname.confd \
		"$pkgdir"/etc/conf.d/$pkgname
	install -D -m644 "doc/beanstalkd.1" "$pkgdir/usr/share/man/man1/beanstalkd.1"
}

sha512sums="347f8cf29501d4bf1a01a472f8f6265d1211eadfaa4e5626c8fcab5b1f8116e1e0ddee2a0c82ac116ee60655a2e3b514d254f98c2154be76109a24d77f7d8210  beanstalkd-1.12.tar.gz
0460ba20e5596308a1a07ce50a8e431de6a86d557e0b4c63097c8d5998dc5704b56bec573fce37619cc4f5c0e7abf28ad251b4279fd6ad7fceb0e93b49d221fe  beanstalkd.confd
6b665411341033c16781f8ef254a527ff60629860fd649bb7aa4b79dabbd87edee8d33a4579a4f451eb8a5fbb979d2cc3f8a23d4c5e2eaa18c7225362f94df3e  beanstalkd.initd
42949d11294b5f42c96d06ce13aff76d596c3268af7442ade669cada29a58ed7612bf88521e6621bb100232b5875c982f3e6ddb1989799d74175135c89981146  remove-werror.patch"
